import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import List from '@/views/List'
import Profile from '@/views/Profile'
import Login from '@/views/Login'
import News from '@/views/News'
import Favoriate from '@/views/Favoriate'
import Rent from '@/views/Rent'
import Add from '@/views/Rent/Add'
import Search from '@/views/Rent/Search'
import Layout from '@/views/Layout'
import Maps from '@/views/Map'
import Detail from '@/views/Detail'
import City from '@/views/City'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'

  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/home',
        component: Home
      },
      {
        path: '/home/profile',
        component: Profile
      },
      {
        path: '/home/news',
        component: News
      },
      {
        path: '/home/list',
        component: List
      }]
  },

  {
    path: '/login',
    component: Login
  },
  {
    path: '/favoriate',
    component: Favoriate
  },
  {
    path: '/rent',
    component: Rent
  },
  {
    path: '/rent/add',
    name: 'renthome',
    component: Add
  },
  {
    path: '/rent/search',
    component: Search
  },
  {
    path: '/map',
    component: Maps
  },
  {
    path: '/detail/:houseCode',
    component: Detail
  },
  {
    path: '/city',
    component: City
  }
]

const router = new VueRouter({
  routes
})

export default router
